package br.edu.univas.si.lab3.bankmanager.view;

import java.awt.Font;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class PanelConta extends JPanel{
	private static final long serialVersionUID = 1L;

	private JLabel conta;
	private JTextField contaField;
	
	public PanelConta (){
		initialize();
	}
	
	private void initialize(){
		add(getContaLabel());
		add(getContaField());
	}
	
	private JLabel getContaLabel(){
		if(conta == null){
			conta = new JLabel("Numero da conta");
			conta.setFont(new Font("Times New Roman", Font.BOLD+Font.ITALIC, 16));
		}
		return conta;
	}
	
	private JTextField getContaField(){
		if(contaField == null){
			contaField = new JTextField(8);
			contaField.setToolTipText("Informe o numero da conta");
		}
		return contaField;
	}
	
	public String getNumeroConta(){
		return getContaField().getText();
	}
}
